package com.stylefeng.guns.modular.system.service.impl;

import com.alipay.api.internal.util.StringUtils;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.stylefeng.guns.modular.system.dao.JaruseMapper;
import com.stylefeng.guns.modular.system.model.Jaruse;
import com.stylefeng.guns.modular.system.service.IJaruseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * jar包信息 服务实现类
 * </p>
 *
 * @author kutty
 * @since 2018-10-23
 */
@Service
public class JaruseServiceImpl extends ServiceImpl<JaruseMapper, Jaruse> implements IJaruseService {

    @Autowired
    JaruseMapper jaruseMapper;

    /**
     * 统计根据渠道和jar包名称有多少条数据
     */
    public Integer selByChannelAndJarName(String channel, String jarName) {
        String s = jaruseMapper.selByChannelAndJarName(channel, jarName).toString();
        if(StringUtils.isEmpty(s)){
            s = "0";
        }
        return Integer.parseInt(s);
    }

}
